# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo1003
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/27
#-------------------------------------------------------------------------------

class Animal:
    def __init__(self):
        print('animal init')

class Bird(Animal):
    def __init__(self,hungry):
        super().__init__()
        self.hungry = hungry

    def eat(self):
        if self.hungry:
            print('已经吃了虫子')
            self.hungry = False

b = Bird(False)
b.eat()
b.eat()

class SongBird(Bird):
    def __init__(self,hungry):
        super(SongBird,self).__init__(hungry)
        self.sound = '向天再借伍佰年'

    def sing(self):
        print(self.sound)

sb = SongBird(True)
sb.sing()
sb.eat()